import java.util.*;

class Result 
{
	private int count = 1;

	public int solve(int[] items, int limit, int start)
	{
		if(start < items.length)
		{
			if(items[start] <= limit)
			{
				count++;
				solve(items, limit, start + 1);
				solve(items, limit - items[start], start + 1);
			}
			else
			{
				solve(items, limit, start + 1);
			}
		}
		return count;
	}
}

class Knapsack 
{
	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int[] items = new int[n];
		for(int i = 0; i < n; i++)
		{
			items[i] = sc.nextInt();
		}
		Result rs = new Result();
		System.out.println(rs.solve(items, k, 0));
	}
}
